import { Router } from 'express';
import { 
  getUserMessages, 
  getMessageDetail, 
  markAllAsRead, 
  deleteMessage, 
  batchDeleteMessages 
} from './controller';
import { verifyToken } from '../../middleware/auth';

const router = Router();

// 所有消息路由都需要身份验证
router.use(verifyToken);

// 获取用户消息列表
router.get('/', getUserMessages);

// 标记所有消息为已读
router.post('/read-all', markAllAsRead);

// 删除单条消息
router.delete('/:id', deleteMessage);

// 批量删除消息
router.post('/batch-delete', batchDeleteMessages);

export default router; 